package pens.penObjects
{
	import flash.geom.Point;
	
	import pens.PenType;

	public class Pen_Sign extends Pen
	{
		private var nowSize:Number=10;
		private var oldX:Number;
		private var oldY:Number;
		
		
	
		
		
		public function Pen_Sign()
		{
			super();
			_penName=PenType.PEN_SIGN
		}
		
		override protected function _end():void
		{
			// TODO Auto Generated method stub
			super._end();
		}
		
		override protected function _lineTo(x:Number, y:Number, size:Number=10, color:uint=0):void
		{
			// TODO Auto Generated method stub
			var dis:Number=Math.sqrt(oldX*oldX+oldY*oldY); 
			var count:int=Math.floor(dis/15); 				
			var pointNew:Point=new Point(x,y)
			var step:Number=Point.distance(pointNew,new Point(oldX,oldY))//求每真移动距离	
			var sp:Number=step*stage.frameRate	
			if(sp<300){
				if(nowSize<PenType.penSize*2) nowSize ++;
			}else{
				if(nowSize>PenType.penSize/2) nowSize --;
			}  
			oldX=pointNew.x
			oldY=pointNew.y
			super._lineTo(x, y, nowSize, color);
		}
		
		override protected function _moveTo(x:Number, y:Number, size:Number=10, color:uint=0):void
		{
			nowSize=size
			// TODO Auto Generated method stub
			super._moveTo(x, y, nowSize, color);
		}
		
		
		
	}
}